﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GenericLibrariesToolKit;
using Model;

namespace BLL.Info.Impl
{
    /// <summary>
    /// 事件业务接口实现
    /// </summary>
    public class EventBOImpl : DaoSupport<Event>, EventBO
    {
        public List<Event> ShowTopEvent(int topNumber)
        {
            Dictionary<string, string> orderByDictionary = new Dictionary<string, string>();
            //添加排序条件及排序方式
            orderByDictionary.Add("EventClickAmount", "desc");
            //执行查询
            QueryResult<Event> eventQueryResult = GetScrollData(0, topNumber, orderByDictionary);
            //获取数据列表
            List<Event> events = eventQueryResult.ResultList;
            return events;
        }

        public List<Event> ShowLatestTopEvent(int topNumber)
        {
            Dictionary<string, string> orderByDate = new Dictionary<string, string>();
            //添加排序条件及排序方式
            orderByDate.Add("EventDate", "desc");
            //执行查询

            QueryResult<Event> eventQueryResult = this.GetScrollData(0, topNumber, orderByDate);
            //获取数据列表
            List<Event> Events = eventQueryResult.ResultList;
            return Events;
        }
    }
}
